home *** CD-ROM | disk | FTP | other *** search
- /*
- CInternetConfig.hpp
-
- Defines the CInternetConfig class. This class is loosely based upon the IC Switch Glue.c file.
-
- */
-
- #pragma once
-
- #ifndef __Hpp_CInternetConfig__
- #define __Hpp_CInternetConfig__
-
- #include "IC Types.h"
- #include "IC Keys.h"
-
- class CInternetConfig {
- private:
- ICInstance theInstance;
- ICError lastError;
-
- protected:
-
- public:
- // constructors & destructors
- CInternetConfig(OSType type=(OSType)0);
- ~CInternetConfig(void);
-
- OSErr MapICError(ICError err=(ICError)0);
- OSErr GetLastError(void);
-
- // Specifying a configuration
- OSErr FindConfigFile(short count=0,ICDirSpecArrayPtr folders=(ICDirSpecArrayPtr)0);
- OSErr FindUserConfigFile(ICDirSpec* where);
- OSErr GeneralFindConfigFile(Boolean search_prefs=true,Boolean can_create=true,
- short count=0,ICDirSpecArrayPtr folders=(ICDirSpecArrayPtr)0);
- OSErr ChooseConfig(void);
- OSErr ChooseNewConfig(void);
- OSErr GetConfigName(StringPtr name,Boolean longname=false);
- OSErr GetConfigReference(ICConfigRefHandle ref);
- OSErr SetConfigReference(ICConfigRefHandle ref,long flags);
- OSErr SpecifyConfigFile(FSSpecPtr spec);
-
- // Getting Information
- OSErr GetSeed(long* seed);
- OSErr GetPerm(ICPerm* perm);
- OSErr DefaultFileName(StringPtr name);
- OSErr GetComponentInstance(Ptr* component_inst);
-
- // Reading And Writing Preferences
- OSErr Begin(ICPerm perm);
- OSErr GetPref(const StringPtr key,ICAttr* attr,Ptr buf,long* size);
- OSErr SetPref(const StringPtr key,ICAttr attr,Ptr buf,long size);
- OSErr FindPrefHandle(const StringPtr key,ICAttr* attr,Handle prefh);
- OSErr GetPrefHandle(const StringPtr key,ICAttr* attr,Handle* prefh);
- OSErr SetPrefHandle(const StringPtr key,ICAttr attr,Handle prefh);
- OSErr CountPref(long* count);
- OSErr GetIndPref(long n,StringPtr key);
- OSErr DeletePref(const StringPtr key);
- OSErr End(void);
-
- // User Interface Stuff
- OSErr EditPreferences(const StringPtr key);
-
- // URL Handling
- OSErr ParseURL(StringPtr hint,Ptr data,long len,long* selStart,long* selEnd,Handle url);
- OSErr LaunchURL(StringPtr hint,Ptr data,long len,long* selStart,long* selEnd);
-
- // Mapping Routines
-
- // High Level
- OSErr MapFilename(StringPtr filename,ICMapEntry* entry);
- OSErr MapTypeCreator(OSType fType,OSType fCreator,StringPtr filename,ICMapEntry* entry);
-
- // Mid Level
- OSErr MapEntriesFilename(Handle entries,StringPtr filename,ICMapEntry* entry);
- OSErr MapEntriesTypeCreator(Handle entries,OSType fType,OSType fCreator,StringPtr filename,
- ICMapEntry* entry);
-
- // Low Level
- OSErr CountMapEntries(Handle entries,long* count);
- OSErr GetIndMapEntry(Handle entries,long ndx,long* pos,ICMapEntry* entry);
- OSErr GetMapEntry(Handle entries,long pos,ICMapEntry* entry);
- OSErr SetMapEntry(Handle entries,long pos,ICMapEntry* entry);
- OSErr DeleteMapEntry(Handle entries,long pos);
- OSErr AddMapEntry(Handle entries,ICMapEntry* entry);
- };
-
- #endif /* __Hpp_CInternetConfig__ */
-
-